home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d18
/
nrpas13.arc
/
SINFT.DEM
< prev
next >
Wrap
Text File
|
1991-05-01
|
1KB
|
65 lines
PROGRAM d12r4(input,output);
(* driver for routine SINFT *)
LABEL 1,99;
CONST
eps=1.0e-3;
np=16;
np2=18; (* np2=np+2 *)
width=30.0;
pi=3.1415926;
TYPE
gldarray=ARRAY [1..np2] OF real;
glyarray=gldarray;
VAR
big,per,scal,small : real;
i,j,nlim : integer;
data,size : gldarray;
(*$I MODFILE.PAS *)
(*$I FOUR1.PAS *)
(*$I REALFT.PAS *)
(*$I SINFT.PAS *)
BEGIN
1: writeln('period of sinusoid in channels (3-',np:2,')');
readln(per);
IF (per <= 0.0) THEN GOTO 99;
FOR i := 1 to np DO BEGIN
data[i] := sin(2.0*pi*(i-1)/per)
END;
sinft(data,np);
big := -1.0e10;
small := 1.0e10;
FOR i := 1 to np DO BEGIN
IF (data[i] < small) THEN small := data[i];
IF (data[i] > big) THEN big := data[i]
END;
scal := width/(big-small);
FOR i := 1 to np DO BEGIN
nlim := round(scal*(data[i]-small)+eps);
write(i:4,' ');
FOR j := 1 to nlim+1 DO write('*');
writeln
END;
writeln('press RETURN to continue ...');
readln;
sinft(data,np);
big := -1.0e10;
small := 1.0e10;
FOR i := 1 to np DO BEGIN
IF (data[i] < small) THEN small := data[i];
IF (data[i] > big) THEN big := data[i]
END;
scal := width/(big-small);
FOR i := 1 to np DO BEGIN
nlim := round(scal*(data[i]-small)+eps);
write(i:4,' ');
FOR j := 1 to nlim+1 DO write('*');
writeln
END;
GOTO 1;
99:
END.